home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / enemy / DroidC.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  20.9 KB  |  685 lines

  1. class classes.enemy.DroidC
  2. {
  3.    var x;
  4.    var y;
  5.    var moveScript;
  6.    var matrixCoords;
  7.    var id;
  8.    var form;
  9.    var clip;
  10.    var advanceMax;
  11.    var advanceMax2;
  12.    var matrixVar;
  13.    var colorR;
  14.    var trans;
  15.    var colorTrans;
  16.    var dir;
  17.    var f2;
  18.    var ac;
  19.    var ep;
  20.    var axis;
  21.    var xDest;
  22.    var yDest;
  23.    var oldDir;
  24.    var xMov = 0;
  25.    var yMov = 0;
  26.    var xmt = 0;
  27.    var ymt = 0;
  28.    var xMovT = 0;
  29.    var yMovT = 0;
  30.    var speedOrig = 9;
  31.    var speed = 9;
  32.    var xDestMet = false;
  33.    var yDestMet = false;
  34.    var c = 0;
  35.    var feelerInfo = [[-400,0,400,40],[0,0,400,40],[0,-400,40,400],[0,0,40,400]];
  36.    var dirArray = ["L","R","U","D"];
  37.    var life = 10;
  38.    var nc = 0;
  39.    var xA = 0;
  40.    var yA = 0;
  41.    var nudging = false;
  42.    var dummyPlanted = false;
  43.    var power = 20;
  44.    var Name = "droidC";
  45.    function DroidC(px, py, pmoveScript, pmatrixCoords, pform, pid)
  46.    {
  47.       this.x = px;
  48.       this.y = py;
  49.       this.moveScript = pmoveScript.slice();
  50.       this.matrixCoords = pmatrixCoords.slice();
  51.       this.id = pid;
  52.       this.form = pform.slice();
  53.       _root.d = _root.d + 1;
  54.       this.clip = _root.attachMovie("droidC","droidC" + this.id + "Clip",_root.d + 50000);
  55.       this.clip._x = this.x;
  56.       this.clip._y = this.y;
  57.       this.speed *= _root.dif.speed;
  58.       this.speedOrig = this.speed;
  59.       this.life *= _root.dif.life;
  60.       this.advanceMax = 60 / (this.speed / 2);
  61.       this.advanceMax2 = 50 / (this.speed / 2);
  62.       if(this.matrixCoords[0] == "free")
  63.       {
  64.          this.matrixVar = 0;
  65.       }
  66.       else
  67.       {
  68.          this.matrixVar = 1;
  69.       }
  70.       this.speedVar();
  71.       this.colorR = _root.randRange(-30,30);
  72.       this.trans = new flash.geom.Transform(this.clip);
  73.       this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,this.colorR,this.colorR,this.colorR,0);
  74.       this.trans.colorTransform = this.colorTrans;
  75.       this.parseMoveScript();
  76.       _root.stats.created = _root.stats.created + 1;
  77.    }
  78.    function broBehind()
  79.    {
  80.       this.dir = _root.advanceDir;
  81.    }
  82.    function bombed(num)
  83.    {
  84.       this.f2 = "death";
  85.    }
  86.    function nudge(pxA, pyA, pscale)
  87.    {
  88.       this.nc = 0;
  89.       this.nudging = true;
  90.       var _loc2_ = pscale / 100;
  91.       this.xA = pxA * _loc2_;
  92.       this.yA = pyA * _loc2_;
  93.    }
  94.    function missleCreep()
  95.    {
  96.       this.matrixVar = 0;
  97.       this.dummyPlanted = true;
  98.       _root.d = _root.d + 1;
  99.       _root["dummy" + this.id] = new classes.misc.Dummy(this.x,this.y,this.id);
  100.       _root.addEnemyShot("dummy" + this.id);
  101.       this.clip.body.flame.gotoAndPlay("advance");
  102.       this.ac = 0;
  103.       this.ep = _root.randRange(20,60);
  104.       this.speed /= 2;
  105.       this.yMovT = 0;
  106.       this.xMovT = this.dir != "L" ? this.speed : -1 * this.speed;
  107.       this.f2 = "missleSeq";
  108.    }
  109.    function missleSeq()
  110.    {
  111.       this.ac = this.ac + 1;
  112.       if(this.ac == this.ep)
  113.       {
  114.          if(this.dir == "L")
  115.          {
  116.             var _loc6_ = 6;
  117.             var _loc10_ = 18;
  118.          }
  119.          else if(this.dir == "R")
  120.          {
  121.             _loc6_ = 0;
  122.             _loc10_ = 18;
  123.          }
  124.          else if(this.dir == "U")
  125.          {
  126.             _loc6_ = 6;
  127.             _loc10_ = 6;
  128.          }
  129.          else
  130.          {
  131.             _loc6_ = 18;
  132.             _loc10_ = 0;
  133.          }
  134.          _root.enemyShotID = _root.enemyShotID + 1;
  135.          _root["droidCMissle" + _root.enemyShotID] = new classes.shots.DroidCMissle(this.x + _loc6_,this.y + _loc10_,this.dir,_root.enemyShotID);
  136.          _root.addEnemyShot("droidCMissle" + _root.enemyShotID);
  137.          this.xMovT = 0;
  138.          _root.audio.playLevel3("droidCMissle2",_root.randRange(22,33));
  139.       }
  140.       if(this.ac == this.ep + 3)
  141.       {
  142.          this.clip.body.gotoAndPlay("flip");
  143.       }
  144.       if(this.ac == this.ep + 11)
  145.       {
  146.          this.speed = this.speedOrig;
  147.          this.dir = this.dir != "L" ? "L" : "R";
  148.          this.axis = "x";
  149.          this.xMovT = this.dir != "L" ? this.speed : -1 * this.speed;
  150.          this.clip.body.gotoAndStop("main");
  151.          this.clip.body.flame.gotoAndPlay("startMain");
  152.          var _loc5_ = _root.advanceDir != "L" ? "L" : "R";
  153.          var _loc4_ = random(2) != 1 ? "D" : "U";
  154.          var _loc9_ = _loc4_ != "U" ? "U" : "D";
  155.          var _loc7_ = _root.randRange(20,50);
  156.          var _loc3_ = !(this.y < 150 && this.y > 450) ? _root.randRange(80,150) : _root.randRange(100,300);
  157.          var _loc8_ = !(this.x < 700 && this.x > 300) ? _root.randRange(80,150) : _root.randRange(100,300);
  158.          this.moveScript = [_loc5_,_loc7_,_loc4_,_loc3_,_loc5_,_loc8_,_loc9_,_loc3_,"return"];
  159.          this.parseMoveScript();
  160.       }
  161.    }
  162.    function gotoMatrix2()
  163.    {
  164.       this.xDest = _root["dummy" + this.id + "Clip"]._x;
  165.       if(Math.abs(this[this.axis + "Dest"] - this[this.axis]) < this.speed + 1)
  166.       {
  167.          if(this.axis == "x")
  168.          {
  169.             this.x = this.xDest;
  170.          }
  171.          else
  172.          {
  173.             this.y = this.yDest;
  174.          }
  175.          this[this.axis + "MovT"] = 0;
  176.          this.axis = this.axis != "x" ? "x" : "y";
  177.          this[this.axis + "MovT"] = this[this.axis + "Dest"] <= this[this.axis] ? -1 * this.speed : this.speed;
  178.          this.getDirString();
  179.          this.speed = this.speedOrig;
  180.       }
  181.       if(Math.abs(this.x - this.xDest) < this.speed + 1 && Math.abs(this.y - this.yDest) < this.speed + 1)
  182.       {
  183.          this.x = this.clip._x = this.xDest;
  184.          this.y = this.clip._y = this.yDest;
  185.          this.xMovT = this.xMov = 0;
  186.          this.yMovT = this.yMov = 0;
  187.          this.matrixVar = 2;
  188.          if(this.dummyPlanted)
  189.          {
  190.             _root.removeEnemyShot("dummy" + this.id);
  191.             this.dummyPlanted = false;
  192.          }
  193.          this.dir = _root.advanceDir;
  194.          this.clip.body.flame.gotoAndPlay("still");
  195.          this.f2 = "wait";
  196.       }
  197.    }
  198.    function speedVar()
  199.    {
  200.       if(random(3) == 1)
  201.       {
  202.          this.speed *= _root.randRange2(0.9999,1.0001);
  203.       }
  204.    }
  205.    function parseMoveScript()
  206.    {
  207.       this.dir = this.moveScript[0];
  208.       if(this.dir == "break")
  209.       {
  210.          delete this.moveScript;
  211.          this[this.axis + "MovT"] = 0;
  212.          if(this.matrixCoords[0] == "free")
  213.          {
  214.             this.f2 = "wander";
  215.             this.axis = random(10) <= 4 ? "y" : "x";
  216.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  217.             this.speedVar();
  218.             this.getDirString();
  219.          }
  220.          else
  221.          {
  222.             this.xDest = _root.advanceDir != "L" ? this.matrixCoords[0] * 60 : this.matrixCoords[0] * 60 + 320;
  223.             this.yDest = this.matrixCoords[1] * 50 + 10;
  224.             this.axis = Math.abs(this.xDest - this.x) <= Math.abs(this.yDest - this.y) ? "y" : "x";
  225.             this[this.axis + "MovT"] = this[this.axis + "Dest"] <= this[this.axis] ? -1 * this.speed : this.speed;
  226.             this.getDirString();
  227.             this.speedVar();
  228.             this.f2 = "gotoMatrix";
  229.          }
  230.       }
  231.       else if(this.dir == "return")
  232.       {
  233.          this.xDest = _root["dummy" + this.id + "Clip"]._x;
  234.          this.yDest = _root["dummy" + this.id + "Clip"]._y;
  235.          this[this.axis + "MovT"] = 0;
  236.          this.axis = Math.abs(this.xDest - this.x) <= Math.abs(this.yDest - this.y) ? "y" : "x";
  237.          this[this.axis + "MovT"] = this[this.axis + "Dest"] <= this[this.axis] ? -1 * this.speed : this.speed;
  238.          this.getDirString();
  239.          this.speedVar();
  240.          this.f2 = "gotoMatrix2";
  241.       }
  242.       else
  243.       {
  244.          this[this.axis + "MovT"] = 0;
  245.          this.f2 = "gotoXYDest";
  246.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  247.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  248.          this.speedVar();
  249.          if(this.dir == "L" || this.dir == "U")
  250.          {
  251.             this[this.axis + "Dest"] = this[this.axis] - this.moveScript[1];
  252.          }
  253.          else
  254.          {
  255.             this[this.axis + "Dest"] = this[this.axis] + this.moveScript[1];
  256.          }
  257.          this.moveScript.splice(0,2);
  258.       }
  259.    }
  260.    function gotoXYDest()
  261.    {
  262.       if(Math.abs(this[this.axis + "Dest"] - this[this.axis]) < this.speed + 1)
  263.       {
  264.          if(this.axis == "x")
  265.          {
  266.             this.x = this.xDest;
  267.          }
  268.          else
  269.          {
  270.             this.y = this.yDest;
  271.          }
  272.          this.parseMoveScript();
  273.       }
  274.    }
  275.    function gotoMatrix()
  276.    {
  277.       if(Math.abs(this[this.axis + "Dest"] - this[this.axis]) < this.speed + 1)
  278.       {
  279.          if(this.axis == "x")
  280.          {
  281.             this.x = this.xDest;
  282.          }
  283.          else
  284.          {
  285.             this.y = this.yDest;
  286.          }
  287.          this[this.axis + "MovT"] = 0;
  288.          this.axis = this.axis != "x" ? "x" : "y";
  289.          this[this.axis + "MovT"] = this[this.axis + "Dest"] <= this[this.axis] ? -1 * this.speed : this.speed;
  290.          this.getDirString();
  291.          this.speed = this.speedOrig;
  292.       }
  293.       if(Math.abs(this.x - this.xDest) < this.speed + 1 && Math.abs(this.y - this.yDest) < this.speed + 1)
  294.       {
  295.          this.x = this.clip._x = this.xDest;
  296.          this.y = this.clip._y = this.yDest;
  297.          this.xMovT = this.xMov = 0;
  298.          this.yMovT = this.yMov = 0;
  299.          this.matrixVar = 2;
  300.          this.dir = _root.advanceDir;
  301.          this.clip.body.flame.gotoAndPlay("still");
  302.          _root.matrixNum = _root.matrixNum + 1;
  303.          if(_root.matrixNum >= _root.matrixSize)
  304.          {
  305.             _root.matrixComplete = true;
  306.          }
  307.          _root["formB" + this.form[0]] = "matrixed";
  308.          this.f2 = "wait";
  309.       }
  310.    }
  311.    function getDirString()
  312.    {
  313.       if(this.xMovT < -1)
  314.       {
  315.          this.dir = "L";
  316.       }
  317.       else if(this.xMovT > 1)
  318.       {
  319.          this.dir = "R";
  320.       }
  321.       else if(this.yMovT > 1)
  322.       {
  323.          this.dir = "D";
  324.       }
  325.       else if(this.yMovT < -1)
  326.       {
  327.          this.dir = "U";
  328.       }
  329.    }
  330.    function evade()
  331.    {
  332.       if(this.matrixVar == 2)
  333.       {
  334.          this.missleCreep();
  335.       }
  336.    }
  337.    function wait()
  338.    {
  339.       if(random(1000) >= 990 + _root.dif.wait * 2 && _root.matrixComplete)
  340.       {
  341.          this.dir = this.findDir();
  342.          if(this.dir == _root.advanceDir)
  343.          {
  344.             if(random(15) > 2)
  345.             {
  346.                this.missleCreep();
  347.             }
  348.             else
  349.             {
  350.                this.ep = _root.randRange(20,80);
  351.                this.ep *= 1 / _root.dif.speed;
  352.                this.ac = 0;
  353.                this.xMovT = _root.advanceDir != "L" ? 1.1 * this.speed : -1.1 * this.speed;
  354.                this.clip.body.gotoAndPlay("attack");
  355.                this.clip.body.face.gotoAndPlay("attack");
  356.                this.clip.body.flame.gotoAndPlay("startAttack");
  357.                this.f2 = "attacking";
  358.                this.matrixVar = 0;
  359.             }
  360.          }
  361.          else if(this.dir == "U" || this.dir == "D")
  362.          {
  363.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  364.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  365.             this.matrixVar = 0;
  366.             this.c = 0;
  367.             this.f2 = "leavingMatrix";
  368.             this.clip.body.flame.gotoAndPlay("startMain");
  369.          }
  370.          else
  371.          {
  372.             this.dir = _root.advanceDir;
  373.          }
  374.       }
  375.    }
  376.    function leavingMatrix()
  377.    {
  378.       this.c = this.c + 1;
  379.       if(this.c > this.advanceMax2)
  380.       {
  381.          this.c = 0;
  382.          this.dir = this.findDir();
  383.          if(this.dir == _root.advanceDir)
  384.          {
  385.             if(random(2) == 1)
  386.             {
  387.                this.missleCreep();
  388.             }
  389.             else
  390.             {
  391.                this.ep = _root.randRange(20,80);
  392.                this.ep *= 1 / _root.dif.speed;
  393.                this.ac = 0;
  394.                this.yMovT = 0;
  395.                this.xMovT = _root.advanceDir != "L" ? 1.1 * this.speed : -1.1 * this.speed;
  396.                this.clip.body.gotoAndPlay("attack");
  397.                this.clip.body.face.gotoAndPlay("attack");
  398.                this.clip.body.flame.gotoAndPlay("attack");
  399.                this.f2 = "attacking";
  400.             }
  401.          }
  402.       }
  403.    }
  404.    function findDir()
  405.    {
  406.       _root.d = _root.d + 1;
  407.       _root.attachMovie("feeler","feelerClip",_root.d);
  408.       var _loc7_ = [];
  409.       var _loc9_ = 0;
  410.       var _loc11_ = this.dirArray.length;
  411.       while(_loc9_ < _loc11_)
  412.       {
  413.          _root.feelerClip._x = this.x + this.feelerInfo[_loc9_][0];
  414.          _root.feelerClip._y = this.y + this.feelerInfo[_loc9_][1];
  415.          _root.feelerClip._width = this.feelerInfo[_loc9_][2];
  416.          _root.feelerClip._height = this.feelerInfo[_loc9_][3];
  417.          var _loc3_ = 0;
  418.          var _loc8_ = _root.chars.length;
  419.          var _loc6_ = false;
  420.          while(_loc3_ < _loc8_)
  421.          {
  422.             var _loc5_ = _root.chars[_loc3_] + "Clip";
  423.             if(_root.feelerClip.hitTest(_root[_loc5_]))
  424.             {
  425.                var _loc4_ = _root.chars[_loc3_];
  426.                if(_root[_loc4_].matrixVar == 2 && _loc4_ != this.Name + this.id)
  427.                {
  428.                   _loc6_ = true;
  429.                   break;
  430.                }
  431.             }
  432.             _loc3_ = _loc3_ + 1;
  433.          }
  434.          if(!_loc6_)
  435.          {
  436.             var _loc10_ = _root.advanceDir != "L" ? "L" : "R";
  437.             if(this.dirArray[_loc9_] != _loc10_)
  438.             {
  439.                _loc7_.push(this.dirArray[_loc9_]);
  440.             }
  441.          }
  442.          _loc9_ = _loc9_ + 1;
  443.       }
  444.       _loc9_ = 0;
  445.       _loc11_ = _loc7_.length;
  446.       if(_loc9_ < _loc11_)
  447.       {
  448.          if(_loc7_[_loc9_] == _root.advanceDir)
  449.          {
  450.             return _root.advanceDir;
  451.          }
  452.          return _loc7_[random(_loc7_.length)];
  453.       }
  454.    }
  455.    function attacking()
  456.    {
  457.       this.ac = this.ac + 1;
  458.       this.xMovT *= 1.01;
  459.       this.yMovT *= 1.01;
  460.       this.speed *= 1.01;
  461.       if(this.ac == this.ep)
  462.       {
  463.          this[this.axis + "MovT"] = 0;
  464.          this.axis = this.axis != "x" ? "x" : "y";
  465.          this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  466.          this.getDirString();
  467.          this.ac = 0;
  468.          this.ep = _root.randRange(20,80);
  469.       }
  470.    }
  471.    function death()
  472.    {
  473.       _root.stats.destroyed = _root.stats.destroyed + 1;
  474.       _root.stats.score += 5000;
  475.       if(this.matrixVar == 1)
  476.       {
  477.          _root.matrixNum = _root.matrixNum + 1;
  478.          if(_root.matrixNum >= _root.matrixSize)
  479.          {
  480.             _root.matrixComplete = true;
  481.          }
  482.       }
  483.       _root.powerUp(this.x,this.y,94);
  484.       if(this.dummyPlanted)
  485.       {
  486.          _root.removeEnemyShot("dummy" + this.id);
  487.          this.dummyPlanted = false;
  488.       }
  489.       var _loc3_ = 0;
  490.       var _loc4_ = _root["form" + this.form[0]].length;
  491.       while(_loc3_ < _loc4_)
  492.       {
  493.          if(_root["form" + this.form[0]][_loc3_] == "droidC" + this.id)
  494.          {
  495.             _root["form" + this.form[0]].splice(_loc3_,1);
  496.             if(_root["form" + this.form[0]].length == 0)
  497.             {
  498.                delete _root["form" + this.form[0]];
  499.                delete _root["formB" + this.form[0]];
  500.                if(_root["formB" + this.form[0]] == "matrixed")
  501.                {
  502.                   _loc3_ = 0;
  503.                   _loc4_ = random(2) + 1;
  504.                   while(_loc3_ < _loc4_)
  505.                   {
  506.                      _root.createPowerUp([this.x,this.y,"coin5"]);
  507.                      _loc3_ = _loc3_ + 1;
  508.                   }
  509.                   _root.stats.score += 5000;
  510.                }
  511.                else
  512.                {
  513.                   _loc3_ = 0;
  514.                   _loc4_ = random(2) + 2;
  515.                   while(_loc3_ < _loc4_)
  516.                   {
  517.                      _root.createPowerUp([this.x,this.y,"coin5"]);
  518.                      _loc3_ = _loc3_ + 1;
  519.                   }
  520.                   _root.stats.score += 10000;
  521.                }
  522.                delete _root["formB" + this.form[0]];
  523.             }
  524.             break;
  525.          }
  526.          _loc3_ = _loc3_ + 1;
  527.       }
  528.       _root.createExploA([this.x + this.clip._width / 2,this.y + this.clip._height / 2,_root.randRange(80,130),_root.randRange(75,100)],"Yellow");
  529.       _loc3_ = 0;
  530.       _loc4_ = random(3);
  531.       while(_loc3_ < _loc4_)
  532.       {
  533.          _root.createShrapnel([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"droidC","Yellow"]);
  534.          _loc3_ = _loc3_ + 1;
  535.       }
  536.       _root.createEnemySoul([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"red"]);
  537.       _root.audio.playLevel4("droidX" + (random(3) + 1),_root.randRange(22,33));
  538.       _root.removeChar("droidC" + this.id);
  539.       this.f2 = "";
  540.    }
  541.    function advance()
  542.    {
  543.       this.dir = _root.advanceDir;
  544.       this.clip.body.flame.gotoAndPlay("advance");
  545.       this.xMovT = _root.advanceDir != "L" ? 1 * (this.speed / 2) : -1 * (this.speed / 2);
  546.       this.f2 = "advancing";
  547.    }
  548.    function advancing()
  549.    {
  550.       this.c = this.c + 1;
  551.       if(this.c > this.advanceMax)
  552.       {
  553.          this.xMovT = 0;
  554.          this.c = 0;
  555.          this.f2 = "wait";
  556.          _root.d = _root.d + 1;
  557.          _root.attachMovie("sight","sightClip",_root.d);
  558.          _root.sightClip.gotoAndStop("hindSight");
  559.          _root.sightClip._x = this.x;
  560.          _root.sightClip._y = this.y;
  561.          _root.sightClip._rotation = 0;
  562.          if(_root.advanceDir == "L")
  563.          {
  564.             _root.sightClip._rotation = 180;
  565.          }
  566.          if(_root.sightClip.hitTest(_root[_root.char].x,_root[_root.char].y,true))
  567.          {
  568.             _root.broBehind();
  569.          }
  570.          removeMovieClip(_root.sightClip);
  571.       }
  572.    }
  573.    function wander()
  574.    {
  575.       if(random(100) > 98 + _root.dif.wander)
  576.       {
  577.          this[this.axis + "MovT"] = 0;
  578.          this.axis = this.axis != "x" ? "x" : "y";
  579.          this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  580.          this.getDirString();
  581.       }
  582.    }
  583.    function death2()
  584.    {
  585.       _root.removeChar("droidC" + this.id);
  586.       this.f2 = "";
  587.    }
  588.    function main()
  589.    {
  590.       this[this.f2]();
  591.       if(this.oldDir != this.dir)
  592.       {
  593.          this.clip.gotoAndStop("fly" + this.dir);
  594.       }
  595.       this.oldDir = this.dir;
  596.       if(this.nudging)
  597.       {
  598.          this.xA *= 0.5;
  599.          this.yA *= 0.5;
  600.          this.nc = this.nc + 1;
  601.          var _loc8_ = 255 - this.nc * 17;
  602.          this.colorTrans.blueOffset = _loc8_;
  603.          this.trans.colorTransform = this.colorTrans;
  604.          if(this.nc == 15)
  605.          {
  606.             this.xA = this.yA = 0;
  607.             this.nudging = false;
  608.             this.colorTrans.blueOffset = this.colorR;
  609.             this.trans.colorTransform = this.colorTrans;
  610.          }
  611.       }
  612.       var _loc4_ = 0;
  613.       var _loc7_ = _root.broShots.length;
  614.       while(_loc4_ < _loc7_)
  615.       {
  616.          var _loc6_ = _root.broShots[_loc4_] + "Clip";
  617.          if(this.clip.hitTest(_root[_loc6_]))
  618.          {
  619.             var _loc3_ = _root.broShots[_loc4_];
  620.             var _loc5_ = this.life;
  621.             this.life -= _root[_loc3_].power;
  622.             if(this.life < 1)
  623.             {
  624.                this.f2 = "death";
  625.             }
  626.             else
  627.             {
  628.                _root.audio.playLevel4("droidHit" + (random(2) + 1),_root.randRange(3,8));
  629.                this.nudge(_root[_loc3_].xMov,_root[_loc3_].yMov,10);
  630.             }
  631.             _root[_root.char].fc = _root[_root.char].fireFreq - _root.rapidVar;
  632.             _root[_loc3_].exploX = this.x + this.clip._width / 2;
  633.             _root[_loc3_].exploY = this.y + this.clip._height / 2;
  634.             _root[_loc3_].hit(_loc5_);
  635.             break;
  636.          }
  637.          _loc4_ = _loc4_ + 1;
  638.       }
  639.       if(this.clip.hitTest(_root[_root.char + "Clip"]))
  640.       {
  641.          _root[_root.char].hit(this.xMov,this.yMov,100,this.power);
  642.          this.f2 = "death";
  643.       }
  644.       if(this.x > 1050 || this.x < -50 || this.y < -50 || this.y > 650)
  645.       {
  646.          delete _root["form" + this.form[0]];
  647.          delete _root["formB" + this.form[0]];
  648.          if(this.dummyPlanted)
  649.          {
  650.             _root.removeEnemyShot("dummy" + this.id);
  651.             this.dummyPlanted = false;
  652.          }
  653.          this.f2 = "death2";
  654.       }
  655.       if(this.xMovT < this.xMov)
  656.       {
  657.          this.xMov -= 1.5;
  658.       }
  659.       else if(this.xMovT > this.xMov)
  660.       {
  661.          this.xMov += 1.5;
  662.       }
  663.       else
  664.       {
  665.          this.xMov = this.xMovT;
  666.       }
  667.       if(this.yMovT < this.yMov)
  668.       {
  669.          this.yMov -= 1.5;
  670.       }
  671.       else if(this.yMovT > this.yMov)
  672.       {
  673.          this.yMov += 1.5;
  674.       }
  675.       else
  676.       {
  677.          this.yMov = this.yMovT;
  678.       }
  679.       this.x += this.xMov + this.xA;
  680.       this.y += this.yMov + this.yA;
  681.       this.clip._x = this.x;
  682.       this.clip._y = this.y;
  683.    }
  684. }
  685.